<% form_tag :action => 'update_relationship', :id => @relationship, :person => @person do %>

<table border="0" cellspacing="3" cellpadding="3" width="100%">
	<tr>
		<td>
			<b>Relationship Type: </b><br>
			<%= @relationship.relationship_type.name rescue nil %>
		</td>
		<td>
			<b>Created By: </b><br>
			<%= @relationship.created_by rescue nil %>
		</td>
		<td>
			<b>Updated By: </b><br>
			<%= @relationship.updated_by rescue nil %>
		</td>
		<td>
			<b>Created At: </b><br>
			<%= @relationship.created_at.strftime("%m/%d/%Y") rescue nil %>
		</td>
		<td>
			<b>Updated At: </b><br>
			<%= @relationship.updated_at.strftime("%m/%d/%Y") rescue nil %>
		</td>
	</tr>
	<tr>
		<td>
			<b>Person: </b><br>
			<%= @relationship.person.full_name rescue nil %>
		</td>
		<td>
			<b>Role: </b><br>
			<%= collection_select(:relationship, :person_role_id, @relationship.relationship_type.relationship_roles, :id, :name)  %>
		</td>
		
	</tr>
	<tr>
		<td>
			<b>Related Person: </b><br>
			<%= @relationship.related_person.full_name rescue nil %>
		</td>
		<td>
			<b>Role: </b><br>
			<%= collection_select(:relationship, :relates_to_role_id, @relationship.relationship_type.relationship_roles, :id, :name)  %>
		</td>
		
	</tr>
	<tr>
		<td><b>Start Date: </b><br>
			<%= date_field :relationship, :start_date,
						   :format => "%d %b %Y",
						   :value => (@relationship.start_date.strftime('%d %b %Y') if @relationship.start_date) rescue nil %>
		</td>
		<td><b>End Date: </b><br>
			<%= date_field :relationship, :end_date,
						   :format => "%d %b %Y",
						   :value => (@relationship.end_date.strftime('%d %b %Y') if @relationship.end_date) rescue nil %>
		</td>
		<td>
			<b>Inactive?: </b><br>
			<%= check_box_tag 'relationship[active]', "1", ! @relationship.active? %>
		</td>
		<td>
			<b>Web Access?: </b><br>
			<%= check_box 'relationship', :web_access %>
		</td>
	</tr>
	<tr>
		<td colspan="4">
			<b>Comments: </b><%= @relationship.comments %>
		</td>
	</tr>
</table>

<%= submit_tag 'Save Changes' %> | <%= link_to 'cancel', :action => 'show', :id => @person %>
<% end %>